/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2021年5月28日
 */
package com.massyframework.beanskin;

import java.util.List;
import java.util.function.Predicate;

/**
 * 一组{@link RequireLibraryDescriptor}.
 * <p>
 * {@link RequireLibraryDescriptors}封装对组内{@link RequireLibraryDescriptor}的查找，过滤和定位方法。
 * </p>
 * @author huangkh
 *
 */
public interface RequireLibraryDescriptors {
	
	/**
	 * 符合{@code filter}要求的首个{@link RequireLibraryDescriptor}
	 *
	 * <p>
	 * 发现任意一个满足{@code filter}要求的模块，立刻返回.
	 * </p>
	 * @param filter {@link Predicate},过滤条件
	 * @return {@link RequireLibraryDescriptor},无符合要求的可返回null.
	 */
	RequireLibraryDescriptor findByFilter(Predicate<RequireLibraryDescriptor> filter);

	/**
	 * 获取所有必须的模块
	 * @return {@link List}
	 */
	List<RequireLibraryDescriptor> getRequires();
	
	/**
	 * 满足{@code filter}的所有必须模板
	 * @param filter {@link Predicate},过滤条件
	 * @return {@link List}
	 */
	List<RequireLibraryDescriptor> getRequires(Predicate<RequireLibraryDescriptor> filter);

	/**
	 * 组内成员的数量
	 * @return {@link int}
	 */
	int size();
}
